<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8" />
    <title>账单修复</title>
    <script th:src="@{/js/jquery.js}"></script>
</head>
<body>

<form name="billInfo">
    <table>
        <tr>
            <td>id:</td>
            <td><input type="text" id="id" name="id" /></td>
        </tr>
        <tr>
            <td>startcount1:</td>
            <td><input type="text" id="startcount1" name="startcount1" /></td>
            <td>startcount2:</td>
            <td><input type="text" id="startcount2" name="startcount2" /></td>
            <td>startcount3:</td>
            <td><input type="text" id="startcount3" name="startcount3" /></td>
            <td>startcount4:</td>
            <td><input type="text" id="startcount4" name="startcount4" /></td>
            <td>startcount5:</td>
            <td><input type="text" id="startcount5" name="startcount5" /></td>
        </tr>
        <tr>
            <td>endcount1:</td>
            <td><input type="text" id="endcount1" name="endcount1" /></td>
            <td>endcount2:</td>
            <td><input type="text" id="endcount2" name="endcount2" /></td>
            <td>endcount3:</td>
            <td><input type="text" id="endcount3" name="endcount3" /></td>
            <td>endcount4:</td>
            <td><input type="text" id="endcount4" name="endcount4" /></td>
            <td>endcount5:</td>
            <td><input type="text" id="endcount5" name="endcount5" /></td>
        </tr>
        <tr>
            <td>price1:</td>
            <td><input type="text" id="price1" name="price1" /></td>
            <td>price2:</td>
            <td><input type="text" id="price2" name="price2" /></td>
            <td>price3:</td>
            <td><input type="text" id="price3" name="price3" /></td>
            <td>price4:</td>
            <td><input type="text" id="price4" name="price4" /></td>
            <td>price5:</td>
            <td><input type="text" id="price5" name="price5" /></td>
        </tr>

        <tr>
            <td colspan="2">
                <input type="button" value="提交" onclick="return add()" />
            </td>
        </tr>
    </table>

</form>
</body>

<script type="text/javascript">
    function add(){
        var id = billInfo.id.value;


        var startcount1 = billInfo.startcount1.value;
        var endcount1 = billInfo.endcount1.value;
        var price1 = billInfo.price1.value;

        var startcount2 = billInfo.startcount2.value;
        var endcount2 = billInfo.endcount2.value;
        var price2 = billInfo.price2.value;

        var startcount3 = billInfo.startcount3.value;
        var endcount3 = billInfo.endcount3.value;
        var price3 = billInfo.price3.value;

        var startcount4 = billInfo.startcount4.value;
        var endcount4 = billInfo.endcount4.value;
        var price4 = billInfo.price4.value;


        var startcount5 = billInfo.startcount5.value;
        var endcount5 = billInfo.endcount5.value;
        var price5 = billInfo.price5.value;
        $(document).ready(function(){
            $.post("/repair",
                {"id":id,"startcount5":startcount5,"endcount5":endcount5,"price5":price5,
                    "startcount1":startcount1,"endcount1":endcount1,"price1":price1,
                    "startcount2":startcount2,"endcount2":endcount2,"price2":price2,
                    "startcount3":startcount3,"endcount3":endcount3,"price3":price3,
                    "startcount4":startcount4,"endcount4":endcount4,"price4":price4
                },
                function(data){
                    if(data == true){
                        alert("成功");
                    }
                    if(data == false){
                        alert("失败");
                    }
                });
        });
    }
</script>
</html>